package com.example.framework.event;

import org.greenrobot.eventbus.EventBus;

/**
 * EventBus调度类
 * Created by chentao
 * on 2021/1/11 16:15
 */
public class EventManager {

    //更新Token状态
    public static final int EVENT_REFRE_TOKEN_STATUS = 1007;


    //更新语言
    public static final int EVENT_RUPDATE_LANGUAUE = 1005;


    /**
     * 注册
     * @param subscriber
     */
    public static void register(Object subscriber) {
        EventBus.getDefault().register(subscriber);
    }

    /**
     * 反注册
     * @param subscriber
     */
    public static void unregister(Object subscriber) {
        EventBus.getDefault().unregister(subscriber);
    }

    public static void post(int type){
        EventBus.getDefault().post(new MessageEvent(type));
    }

    public static void post(MessageEvent event){
        EventBus.getDefault().post(event);
    }

}
